#ifndef  __AD12_H__
#define	 __AD12_H__
#include "iodefine.h"
#include "compler.h"
   #ifndef __AD12_C__
     #define EFunc extern
     #define EDat  extern
   #else
     #define EFunc
     #define EDat
   #endif

EFunc void ad120_init(void);
EFunc void ad121_init(void);
EFunc void ad10_init(void);
#define is_cmp_00_out()  (S12AD.ADCMPFR.BIT.C000FLAG==1)
#define is_cmp_01_out()  (S12AD.ADCMPFR.BIT.C001FLAG==1)
#define is_cmp_02_out()  (S12AD.ADCMPFR.BIT.C002FLAG==1)
#define is_cmp_10_out()  (S12AD.ADCMPFR.BIT.C100FLAG==1)
#define is_cmp_11_out()  (S12AD.ADCMPFR.BIT.C101FLAG==1)
#define is_cmp_12_out()  (S12AD.ADCMPFR.BIT.C102FLAG==1)
#define clr_cmp_00out() do {S12AD.ADCMPFR.BIT.C000FLAG=0;}while(0)
#define clr_cmp_01out() do {S12AD.ADCMPFR.BIT.C001FLAG=0;}while(0)
#define clr_cmp_02out() do {S12AD.ADCMPFR.BIT.C002FLAG=0;}while(0)
#define clr_cmp_out() do {S12AD.ADCMPFR.BYTE=0;}while(0)

#undef EFunc
#undef EDat
#endif